package org.manon.json.io;

import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.Map;

import org.manon.json.Reusable;

/**
 * @author <a href="mailto:jacques.militello@gmail.com">Jacques Militello</a>
 */
public abstract class InputReader implements Reusable{

	protected InputStream _inputStream;

	public void setInputStream(InputStream inputStream) throws IOException {
		reset();
		_inputStream = inputStream;
	}
	
	public abstract <T> T read(Deserializer<T> deserializer) throws IOException;

	public abstract <T> void readArray(Collection<T> collection,Deserializer<T> deserializer) throws IOException;

	public abstract void readMap(@SuppressWarnings("rawtypes") Map map,Converter k,@SuppressWarnings("rawtypes") Deserializer deserializer) throws IOException;
	
	public abstract void readMap(@SuppressWarnings("rawtypes") Map map,Converter k,Converter v) throws IOException;
}